import type { LoginMenu } from '@/typings'
import type { RouteRecordRaw } from 'vue-router'
import Layout from '@/layout/index.vue'

export const staticRoutes: Array<RouteRecordRaw> = [
  {
    path: '/login',
    component: () => import(/* webpackChunkName: "login" */ '@/views/login/index.vue'),
    meta: { title: '登录' }
  },
  {
    path: '/redirect',
    component: Layout,
    children: [
      {
        path: '/redirect/:path(.*)',
        component: () => import(/* webpackChunkName: "redirect" */ '@/views/redirect')
      }
    ]
  }
]

export const staticMenus: Array<LoginMenu> = [
  {
    menuId: 'me-pwd',
    menuName: '修改密码',
    path: 'me/pwd',
    component: 'system/me/Pwd',
    parentId: '',
    iconClass: '',
    hidden: 0,
    funcKeys: [],
    children: [],
    affix: false,
    noCache: false
  },
  {
    menuId: 'system-job-log',
    menuName: '定时任务日志',
    path: 'system/job/log',
    component: 'system/job/Log',
    parentId: '',
    iconClass: '',
    hidden: 1,
    funcKeys: [],
    children: [],
    affix: false,
    noCache: false,
    dependentAuth: {
      //依赖于system/job/index组件的OpenLog权限
      component: 'system/job/index',
      funcKey: 'OpenLog'
    }
  },
  {
    menuId: 'flw-def-flow-design',
    menuName: '流程设计',
    path: 'flw/def/flow/design',
    component: 'flw/def/flow/Design',
    parentId: '',
    iconClass: '',
    hidden: 1,
    funcKeys: [],
    children: [],
    affix: false,
    noCache: false
  },
  {
    menuId: 'flw-def-form-design',
    menuName: '表单设计',
    path: 'flw/def/form/design',
    component: 'flw/def/form/Design',
    parentId: '',
    iconClass: '',
    hidden: 1,
    funcKeys: [],
    children: [],
    affix: false,
    noCache: false,
    dependentAuth: {
      //依赖于flw/form/index组件的DesignForm权限
      component: 'flw/def/form/index',
      funcKey: 'DesignForm'
    }
  },
  {
    menuId: 'flw-def-form-preview',
    menuName: '预览表单',
    path: 'flw/def/form/preview',
    component: 'flw/def/form/Preview',
    parentId: '',
    iconClass: '',
    hidden: 1,
    funcKeys: [],
    children: [],
    affix: false,
    noCache: false
  },
  {
    menuId: 'flw-inst-apply-form',
    menuName: '申请表单',
    path: 'flw/inst/apply/form',
    component: 'flw/inst/apply/Form',
    parentId: '',
    iconClass: '',
    hidden: 1,
    funcKeys: [],
    children: [],
    affix: false,
    noCache: false
  },
  {
    menuId: 'flw-inst-approve-form',
    menuName: '审批表单',
    path: 'flw/inst/approve/form',
    component: 'flw/inst/approve/Form',
    parentId: '',
    iconClass: '',
    hidden: 1,
    funcKeys: [],
    children: [],
    affix: false,
    noCache: false
  },
  {
    menuId: 'flw-inst-view-form',
    menuName: '查看表单',
    path: 'flw/inst/view/form',
    component: 'flw/inst/view/Form',
    parentId: '',
    iconClass: '',
    hidden: 1,
    funcKeys: [],
    children: [],
    affix: false,
    noCache: false
  }
]
